#include "../../client/rpc_client.hpp"
#include <thread>


void callback(const std::string &key,const std::string &msg)
{
    ILOG("[%s]推送消息：%s",key.c_str(),msg.c_str());
}
int main()
{
    auto client = std::make_shared<Json_rpc::client::TopicClient>("127.0.0.1",8080);

    bool ret =client->create("news");
    if(ret==false)
    {
        ELOG("创建失败");
        return 0;
    }
    client->subscribe("news",callback);

    std::this_thread::sleep_for(std::chrono::seconds(20));
    client->shutdown();
    return 0;
}